package com.yx.changdao.web.config.shiro.token;

import org.apache.shiro.authc.UsernamePasswordToken;

import javax.servlet.http.HttpServletRequest;
import java.io.Serializable;

/**
 * @Description: <br/>
 * 自定义token <br/>
 * 用于验证用户名密码验证码
 * <p>
 * <br/>
 * @Auther: zhangqi
 * @create 2019/11/13 13:42
 */
public class LoginToken extends UsernamePasswordToken implements Serializable {

    /**
     * http:请求域
     */
    private HttpServletRequest request;

    /**
     * 验证码
     */
    private String verification;

    /**
     * 登录ip
     */
    private String ip;


    public LoginToken() {
    }

    public LoginToken(String username, char[] password, String verification, String ip) {
        super(username, password);
        this.verification = verification;
        this.ip = ip;
    }

    public LoginToken(String username, char[] password, String verification) {
        super(username, password);
        this.verification = verification;
    }

    public LoginToken(String username, char[] password, HttpServletRequest request, String verification) {
        super(username, password);
        this.request = request;
        this.verification = verification;
        this.ip = ip;
    }

    public LoginToken(String username, char[] password) {
        super(username, password);
    }

    public String getVerification() {
        return verification;
    }

    public void setVerification(String verification) {
        this.verification = verification;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public HttpServletRequest getRequest() {
        return request;
    }

    public void setRequest(HttpServletRequest request) {
        this.request = request;
    }
}
